<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
    String ctx = request.getContextPath();
    request.setAttribute("ctx", ctx);
%>
<html>
<head>
    <script src="js/jquery-1.8.2.min.js"></script>
</head>
<body>
    登陆
    <form action="login.do" method="post">
        用户名:<input type="text" name="uname" onblur="yzname()"><br>
        密码:<input type="text" name="upwd" onblur="yzpwd()"><br>
        <input type="submit" value="登陆">
    </form>
</body>
<script>
    // 参照图示实现登录，进行用户名、密码非空校验（3分）
    function yzname() {
        var name=$("[name='uname']").val()
        if (name.length==0){
            alert("姓名不能为空")
        }
    }
    function yzpwd(){
        var upwd=$("[name='upwd']").val()
        if (upwd.length==0){
            alert("密码不能为空")
        }
    }
</script>
</html>
